<template>
    <el-dialog :append-to-body="true" v-model="visibleDialog" width="700px" :title="title"
        :close-on-click-modal="true" :close-on-press-escape="true" @close="close" :show-close="false" modal-class="quote-dialog">
        <template #header="{ close, titleId, titleClass }">
            <div class="quote-header">
                <div class="title">{{ title }}</div>
                <div class="c-primary f-14 pointer">查看全文</div>
            </div>
        </template>
        <div class="quote-content-view">
            <MarkdownView :content="currentData.content" />
        </div>
    </el-dialog>
</template>
<script setup>
import MarkdownView from "./MarkdownView/index.vue";
const visibleDialog = ref(false)
const title = ref('')

const currentData = ref({})
const open = (data) => {
    visibleDialog.value = true
    title.value = data.document_name
    currentData.value = data
}
const close = () => {
    visibleDialog.value = false
}
defineExpose({ open });
</script>
<style  lang="scss">
.quote-content-view {
    padding: 20px;
    overflow: auto;
}
.quote-dialog .el-dialog__header{
    padding: 16px !important;
}
.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    .title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 20px;
        font-weight: bold;
    }
}
</style>
